#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include <capstone/capstone.h>
#include "global.h"
#include "disassemble.h"
#include "insthandler_arm.h"
#include "reverse_exe.h"

#define insn_systems 0xE000


// function points table for instruction resolver
// Be careful! If you uncomment one instruction type in the middle,
// please modify all the following entries
op_index_pair_t opcode_index_tab[] = {
    {ARM_INS_INVALID, 0x000},
    {ARM_INS_ASR, 0x001},
    {ARM_INS_IT, 0x002},
    {ARM_INS_LDRBT, 0x003},
    {ARM_INS_LDR, 0x004},
    {ARM_INS_LDRHT, 0x005},
    {ARM_INS_LDRSBT, 0x006},
    {ARM_INS_LDRSHT, 0x007},
    {ARM_INS_LDRT, 0x008},
    {ARM_INS_LSL, 0x009},
    {ARM_INS_LSR, 0x00A},
    {ARM_INS_ROR, 0x00B},
    {ARM_INS_RRX, 0x00C},
    {ARM_INS_STRBT, 0x00D},
    {ARM_INS_STRT, 0x00E},
    {ARM_INS_VLD1, 0x00F},
    {ARM_INS_VLD2, 0x010},
    {ARM_INS_VLD3, 0x011},
    {ARM_INS_VLD4, 0x012},
    {ARM_INS_VST1, 0x013},
    {ARM_INS_VST2, 0x014},
    {ARM_INS_VST3, 0x015},
    {ARM_INS_VST4, 0x016},
    {ARM_INS_LDRB, 0x017},
    {ARM_INS_LDRH, 0x018},
    {ARM_INS_LDRSB, 0x019},
    {ARM_INS_LDRSH, 0x01A},
    {ARM_INS_MOVS, 0x01B},
    {ARM_INS_MOV, 0x01C},
    {ARM_INS_STR, 0x01D},
    {ARM_INS_ADC, 0x01E},
    {ARM_INS_ADD, 0x01F},
    {ARM_INS_ADR, 0x020},
    {ARM_INS_AESD, 0x021},
    {ARM_INS_AESE, 0x022},
    {ARM_INS_AESIMC, 0x023},
    {ARM_INS_AESMC, 0x024},
    {ARM_INS_AND, 0x025},
    {ARM_INS_VDOT, 0x026},
    {ARM_INS_VCVT, 0x027},
    {ARM_INS_VCVTB, 0x028},
    {ARM_INS_VCVTT, 0x029},
    {ARM_INS_BFC, 0x02A},
    {ARM_INS_BFI, 0x02B},
    {ARM_INS_BIC, 0x02C},
    {ARM_INS_BKPT, 0x02D},
    {ARM_INS_BL, 0x02E},
    {ARM_INS_BLX, 0x02F},
    {ARM_INS_BX, 0x030},
    {ARM_INS_BXJ, 0x031},
    {ARM_INS_B, 0x032},
    {ARM_INS_CX1, 0x033},
    {ARM_INS_CX1A, 0x034},
    {ARM_INS_CX1D, 0x035},
    {ARM_INS_CX1DA, 0x036},
    {ARM_INS_CX2, 0x037},
    {ARM_INS_CX2A, 0x038},
    {ARM_INS_CX2D, 0x039},
    {ARM_INS_CX2DA, 0x03A},
    {ARM_INS_CX3, 0x03B},
    {ARM_INS_CX3A, 0x03C},
    {ARM_INS_CX3D, 0x03D},
    {ARM_INS_CX3DA, 0x03E},
    {ARM_INS_VCX1A, 0x03F},
    {ARM_INS_VCX1, 0x040},
    {ARM_INS_VCX2A, 0x041},
    {ARM_INS_VCX2, 0x042},
    {ARM_INS_VCX3A, 0x043},
    {ARM_INS_VCX3, 0x044},
    {ARM_INS_CDP, 0x045},
    {ARM_INS_CDP2, 0x046},
    {ARM_INS_CLREX, 0x047},
    {ARM_INS_CLZ, 0x048},
    {ARM_INS_CMN, 0x049},
    {ARM_INS_CMP, 0x04A},
    {ARM_INS_CPS, 0x04B},
    {ARM_INS_CRC32B, 0x04C},
    {ARM_INS_CRC32CB, 0x04D},
    {ARM_INS_CRC32CH, 0x04E},
    {ARM_INS_CRC32CW, 0x04F},
    {ARM_INS_CRC32H, 0x050},
    {ARM_INS_CRC32W, 0x051},
    {ARM_INS_DBG, 0x052},
    {ARM_INS_DMB, 0x053},
    {ARM_INS_DSB, 0x054},
    {ARM_INS_EOR, 0x055},
    {ARM_INS_ERET, 0x056},
    {ARM_INS_VMOV, 0x057},
    {ARM_INS_FLDMDBX, 0x058},
    {ARM_INS_FLDMIAX, 0x059},
    {ARM_INS_VMRS, 0x05A},
    {ARM_INS_FSTMDBX, 0x05B},
    {ARM_INS_FSTMIAX, 0x05C},
    {ARM_INS_HINT, 0x05D},
    {ARM_INS_HLT, 0x05E},
    {ARM_INS_HVC, 0x05F},
    {ARM_INS_ISB, 0x060},
    {ARM_INS_LDA, 0x061},
    {ARM_INS_LDAB, 0x062},
    {ARM_INS_LDAEX, 0x063},
    {ARM_INS_LDAEXB, 0x064},
    {ARM_INS_LDAEXD, 0x065},
    {ARM_INS_LDAEXH, 0x066},
    {ARM_INS_LDAH, 0x067},
    {ARM_INS_LDC2L, 0x068},
    {ARM_INS_LDC2, 0x069},
    {ARM_INS_LDCL, 0x06A},
    {ARM_INS_LDC, 0x06B},
    {ARM_INS_LDMDA, 0x06C},
    {ARM_INS_LDMDB, 0x06D},
    {ARM_INS_LDM, 0x06E},
    {ARM_INS_LDMIB, 0x06F},
    {ARM_INS_LDRD, 0x070},
    {ARM_INS_LDREX, 0x071},
    {ARM_INS_LDREXB, 0x072},
    {ARM_INS_LDREXD, 0x073},
    {ARM_INS_LDREXH, 0x074},
    {ARM_INS_MCR, 0x075},
    {ARM_INS_MCR2, 0x076},
    {ARM_INS_MCRR, 0x077},
    {ARM_INS_MCRR2, 0x078},
    {ARM_INS_MLA, 0x079},
    {ARM_INS_MLS, 0x07A},
    {ARM_INS_MOVT, 0x07B},
    {ARM_INS_MOVW, 0x07C},
    {ARM_INS_MRC, 0x07D},
    {ARM_INS_MRC2, 0x07E},
    {ARM_INS_MRRC, 0x07F},
    {ARM_INS_MRRC2, 0x080},
    {ARM_INS_MRS, 0x081},
    {ARM_INS_MSR, 0x082},
    {ARM_INS_MUL, 0x083},
    {ARM_INS_ASRL, 0x084},
    {ARM_INS_DLSTP, 0x085},
    {ARM_INS_LCTP, 0x086},
    {ARM_INS_LETP, 0x087},
    {ARM_INS_LSLL, 0x088},
    {ARM_INS_LSRL, 0x089},
    {ARM_INS_SQRSHR, 0x08A},
    {ARM_INS_SQRSHRL, 0x08B},
    {ARM_INS_SQSHL, 0x08C},
    {ARM_INS_SQSHLL, 0x08D},
    {ARM_INS_SRSHR, 0x08E},
    {ARM_INS_SRSHRL, 0x08F},
    {ARM_INS_UQRSHL, 0x090},
    {ARM_INS_UQRSHLL, 0x091},
    {ARM_INS_UQSHL, 0x092},
    {ARM_INS_UQSHLL, 0x093},
    {ARM_INS_URSHR, 0x094},
    {ARM_INS_URSHRL, 0x095},
    {ARM_INS_VABAV, 0x096},
    {ARM_INS_VABD, 0x097},
    {ARM_INS_VABS, 0x098},
    {ARM_INS_VADC, 0x099},
    {ARM_INS_VADCI, 0x09A},
    {ARM_INS_VADDLVA, 0x09B},
    {ARM_INS_VADDLV, 0x09C},
    {ARM_INS_VADDVA, 0x09D},
    {ARM_INS_VADDV, 0x09E},
    {ARM_INS_VADD, 0x09F},
    {ARM_INS_VAND, 0x0A0},
    {ARM_INS_VBIC, 0x0A1},
    {ARM_INS_VBRSR, 0x0A2},
    {ARM_INS_VCADD, 0x0A3},
    {ARM_INS_VCLS, 0x0A4},
    {ARM_INS_VCLZ, 0x0A5},
    {ARM_INS_VCMLA, 0x0A6},
    {ARM_INS_VCMP, 0x0A7},
    {ARM_INS_VCMUL, 0x0A8},
    {ARM_INS_VCTP, 0x0A9},
    {ARM_INS_VCVTA, 0x0AA},
    {ARM_INS_VCVTM, 0x0AB},
    {ARM_INS_VCVTN, 0x0AC},
    {ARM_INS_VCVTP, 0x0AD},
    {ARM_INS_VDDUP, 0x0AE},
    {ARM_INS_VDUP, 0x0AF},
    {ARM_INS_VDWDUP, 0x0B0},
    {ARM_INS_VEOR, 0x0B1},
    {ARM_INS_VFMAS, 0x0B2},
    {ARM_INS_VFMA, 0x0B3},
    {ARM_INS_VFMS, 0x0B4},
    {ARM_INS_VHADD, 0x0B5},
    {ARM_INS_VHCADD, 0x0B6},
    {ARM_INS_VHSUB, 0x0B7},
    {ARM_INS_VIDUP, 0x0B8},
    {ARM_INS_VIWDUP, 0x0B9},
    {ARM_INS_VLD20, 0x0BA},
    {ARM_INS_VLD21, 0x0BB},
    {ARM_INS_VLD40, 0x0BC},
    {ARM_INS_VLD41, 0x0BD},
    {ARM_INS_VLD42, 0x0BE},
    {ARM_INS_VLD43, 0x0BF},
    {ARM_INS_VLDRB, 0x0C0},
    {ARM_INS_VLDRD, 0x0C1},
    {ARM_INS_VLDRH, 0x0C2},
    {ARM_INS_VLDRW, 0x0C3},
    {ARM_INS_VMAXAV, 0x0C4},
    {ARM_INS_VMAXA, 0x0C5},
    {ARM_INS_VMAXNMAV, 0x0C6},
    {ARM_INS_VMAXNMA, 0x0C7},
    {ARM_INS_VMAXNMV, 0x0C8},
    {ARM_INS_VMAXNM, 0x0C9},
    {ARM_INS_VMAXV, 0x0CA},
    {ARM_INS_VMAX, 0x0CB},
    {ARM_INS_VMINAV, 0x0CC},
    {ARM_INS_VMINA, 0x0CD},
    {ARM_INS_VMINNMAV, 0x0CE},
    {ARM_INS_VMINNMA, 0x0CF},
    {ARM_INS_VMINNMV, 0x0D0},
    {ARM_INS_VMINNM, 0x0D1},
    {ARM_INS_VMINV, 0x0D2},
    {ARM_INS_VMIN, 0x0D3},
    {ARM_INS_VMLADAVA, 0x0D4},
    {ARM_INS_VMLADAVAX, 0x0D5},
    {ARM_INS_VMLADAV, 0x0D6},
    {ARM_INS_VMLADAVX, 0x0D7},
    {ARM_INS_VMLALDAVA, 0x0D8},
    {ARM_INS_VMLALDAVAX, 0x0D9},
    {ARM_INS_VMLALDAV, 0x0DA},
    {ARM_INS_VMLALDAVX, 0x0DB},
    {ARM_INS_VMLAS, 0x0DC},
    {ARM_INS_VMLA, 0x0DD},
    {ARM_INS_VMLSDAVA, 0x0DE},
    {ARM_INS_VMLSDAVAX, 0x0DF},
    {ARM_INS_VMLSDAV, 0x0E0},
    {ARM_INS_VMLSDAVX, 0x0E1},
    {ARM_INS_VMLSLDAVA, 0x0E2},
    {ARM_INS_VMLSLDAVAX, 0x0E3},
    {ARM_INS_VMLSLDAV, 0x0E4},
    {ARM_INS_VMLSLDAVX, 0x0E5},
    {ARM_INS_VMOVLB, 0x0E6},
    {ARM_INS_VMOVLT, 0x0E7},
    {ARM_INS_VMOVNB, 0x0E8},
    {ARM_INS_VMOVNT, 0x0E9},
    {ARM_INS_VMULH, 0x0EA},
    {ARM_INS_VMULLB, 0x0EB},
    {ARM_INS_VMULLT, 0x0EC},
    {ARM_INS_VMUL, 0x0ED},
    {ARM_INS_VMVN, 0x0EE},
    {ARM_INS_VNEG, 0x0EF},
    {ARM_INS_VORN, 0x0F0},
    {ARM_INS_VORR, 0x0F1},
    {ARM_INS_VPNOT, 0x0F2},
    {ARM_INS_VPSEL, 0x0F3},
    {ARM_INS_VPST, 0x0F4},
    {ARM_INS_VPT, 0x0F5},
    {ARM_INS_VQABS, 0x0F6},
    {ARM_INS_VQADD, 0x0F7},
    {ARM_INS_VQDMLADHX, 0x0F8},
    {ARM_INS_VQDMLADH, 0x0F9},
    {ARM_INS_VQDMLAH, 0x0FA},
    {ARM_INS_VQDMLASH, 0x0FB},
    {ARM_INS_VQDMLSDHX, 0x0FC},
    {ARM_INS_VQDMLSDH, 0x0FD},
    {ARM_INS_VQDMULH, 0x0FE},
    {ARM_INS_VQDMULLB, 0x0FF},
    {ARM_INS_VQDMULLT, 0x100},
    {ARM_INS_VQMOVNB, 0x101},
    {ARM_INS_VQMOVNT, 0x102},
    {ARM_INS_VQMOVUNB, 0x103},
    {ARM_INS_VQMOVUNT, 0x104},
    {ARM_INS_VQNEG, 0x105},
    {ARM_INS_VQRDMLADHX, 0x106},
    {ARM_INS_VQRDMLADH, 0x107},
    {ARM_INS_VQRDMLAH, 0x108},
    {ARM_INS_VQRDMLASH, 0x109},
    {ARM_INS_VQRDMLSDHX, 0x10A},
    {ARM_INS_VQRDMLSDH, 0x10B},
    {ARM_INS_VQRDMULH, 0x10C},
    {ARM_INS_VQRSHL, 0x10D},
    {ARM_INS_VQRSHRNB, 0x10E},
    {ARM_INS_VQRSHRNT, 0x10F},
    {ARM_INS_VQRSHRUNB, 0x110},
    {ARM_INS_VQRSHRUNT, 0x111},
    {ARM_INS_VQSHLU, 0x112},
    {ARM_INS_VQSHL, 0x113},
    {ARM_INS_VQSHRNB, 0x114},
    {ARM_INS_VQSHRNT, 0x115},
    {ARM_INS_VQSHRUNB, 0x116},
    {ARM_INS_VQSHRUNT, 0x117},
    {ARM_INS_VQSUB, 0x118},
    {ARM_INS_VREV16, 0x119},
    {ARM_INS_VREV32, 0x11A},
    {ARM_INS_VREV64, 0x11B},
    {ARM_INS_VRHADD, 0x11C},
    {ARM_INS_VRINTA, 0x11D},
    {ARM_INS_VRINTM, 0x11E},
    {ARM_INS_VRINTN, 0x11F},
    {ARM_INS_VRINTP, 0x120},
    {ARM_INS_VRINTX, 0x121},
    {ARM_INS_VRINTZ, 0x122},
    {ARM_INS_VRMLALDAVHA, 0x123},
    {ARM_INS_VRMLALDAVHAX, 0x124},
    {ARM_INS_VRMLALDAVH, 0x125},
    {ARM_INS_VRMLALDAVHX, 0x126},
    {ARM_INS_VRMLSLDAVHA, 0x127},
    {ARM_INS_VRMLSLDAVHAX, 0x128},
    {ARM_INS_VRMLSLDAVH, 0x129},
    {ARM_INS_VRMLSLDAVHX, 0x12A},
    {ARM_INS_VRMULH, 0x12B},
    {ARM_INS_VRSHL, 0x12C},
    {ARM_INS_VRSHRNB, 0x12D},
    {ARM_INS_VRSHRNT, 0x12E},
    {ARM_INS_VRSHR, 0x12F},
    {ARM_INS_VSBC, 0x130},
    {ARM_INS_VSBCI, 0x131},
    {ARM_INS_VSHLC, 0x132},
    {ARM_INS_VSHLLB, 0x133},
    {ARM_INS_VSHLLT, 0x134},
    {ARM_INS_VSHL, 0x135},
    {ARM_INS_VSHRNB, 0x136},
    {ARM_INS_VSHRNT, 0x137},
    {ARM_INS_VSHR, 0x138},
    {ARM_INS_VSLI, 0x139},
    {ARM_INS_VSRI, 0x13A},
    {ARM_INS_VST20, 0x13B},
    {ARM_INS_VST21, 0x13C},
    {ARM_INS_VST40, 0x13D},
    {ARM_INS_VST41, 0x13E},
    {ARM_INS_VST42, 0x13F},
    {ARM_INS_VST43, 0x140},
    {ARM_INS_VSTRB, 0x141},
    {ARM_INS_VSTRD, 0x142},
    {ARM_INS_VSTRH, 0x143},
    {ARM_INS_VSTRW, 0x144},
    {ARM_INS_VSUB, 0x145},
    {ARM_INS_WLSTP, 0x146},
    {ARM_INS_MVN, 0x147},
    {ARM_INS_ORR, 0x148},
    {ARM_INS_PKHBT, 0x149},
    {ARM_INS_PKHTB, 0x14A},
    {ARM_INS_PLDW, 0x14B},
    {ARM_INS_PLD, 0x14C},
    {ARM_INS_PLI, 0x14D},
    {ARM_INS_QADD, 0x14E},
    {ARM_INS_QADD16, 0x14F},
    {ARM_INS_QADD8, 0x150},
    {ARM_INS_QASX, 0x151},
    {ARM_INS_QDADD, 0x152},
    {ARM_INS_QDSUB, 0x153},
    {ARM_INS_QSAX, 0x154},
    {ARM_INS_QSUB, 0x155},
    {ARM_INS_QSUB16, 0x156},
    {ARM_INS_QSUB8, 0x157},
    {ARM_INS_RBIT, 0x158},
    {ARM_INS_REV, 0x159},
    {ARM_INS_REV16, 0x15A},
    {ARM_INS_REVSH, 0x15B},
    {ARM_INS_RFEDA, 0x15C},
    {ARM_INS_RFEDB, 0x15D},
    {ARM_INS_RFEIA, 0x15E},
    {ARM_INS_RFEIB, 0x15F},
    {ARM_INS_RSB, 0x160},
    {ARM_INS_RSC, 0x161},
    {ARM_INS_SADD16, 0x162},
    {ARM_INS_SADD8, 0x163},
    {ARM_INS_SASX, 0x164},
    {ARM_INS_SB, 0x165},
    {ARM_INS_SBC, 0x166},
    {ARM_INS_SBFX, 0x167},
    {ARM_INS_SDIV, 0x168},
    {ARM_INS_SEL, 0x169},
    {ARM_INS_SETEND, 0x16A},
    {ARM_INS_SETPAN, 0x16B},
    {ARM_INS_SHA1C, 0x16C},
    {ARM_INS_SHA1H, 0x16D},
    {ARM_INS_SHA1M, 0x16E},
    {ARM_INS_SHA1P, 0x16F},
    {ARM_INS_SHA1SU0, 0x170},
    {ARM_INS_SHA1SU1, 0x171},
    {ARM_INS_SHA256H, 0x172},
    {ARM_INS_SHA256H2, 0x173},
    {ARM_INS_SHA256SU0, 0x174},
    {ARM_INS_SHA256SU1, 0x175},
    {ARM_INS_SHADD16, 0x176},
    {ARM_INS_SHADD8, 0x177},
    {ARM_INS_SHASX, 0x178},
    {ARM_INS_SHSAX, 0x179},
    {ARM_INS_SHSUB16, 0x17A},
    {ARM_INS_SHSUB8, 0x17B},
    {ARM_INS_SMC, 0x17C},
    {ARM_INS_SMLABB, 0x17D},
    {ARM_INS_SMLABT, 0x17E},
    {ARM_INS_SMLAD, 0x17F},
    {ARM_INS_SMLADX, 0x180},
    {ARM_INS_SMLAL, 0x181},
    {ARM_INS_SMLALBB, 0x182},
    {ARM_INS_SMLALBT, 0x183},
    {ARM_INS_SMLALD, 0x184},
    {ARM_INS_SMLALDX, 0x185},
    {ARM_INS_SMLALTB, 0x186},
    {ARM_INS_SMLALTT, 0x187},
    {ARM_INS_SMLATB, 0x188},
    {ARM_INS_SMLATT, 0x189},
    {ARM_INS_SMLAWB, 0x18A},
    {ARM_INS_SMLAWT, 0x18B},
    {ARM_INS_SMLSD, 0x18C},
    {ARM_INS_SMLSDX, 0x18D},
    {ARM_INS_SMLSLD, 0x18E},
    {ARM_INS_SMLSLDX, 0x18F},
    {ARM_INS_SMMLA, 0x190},
    {ARM_INS_SMMLAR, 0x191},
    {ARM_INS_SMMLS, 0x192},
    {ARM_INS_SMMLSR, 0x193},
    {ARM_INS_SMMUL, 0x194},
    {ARM_INS_SMMULR, 0x195},
    {ARM_INS_SMUAD, 0x196},
    {ARM_INS_SMUADX, 0x197},
    {ARM_INS_SMULBB, 0x198},
    {ARM_INS_SMULBT, 0x199},
    {ARM_INS_SMULL, 0x19A},
    {ARM_INS_SMULTB, 0x19B},
    {ARM_INS_SMULTT, 0x19C},
    {ARM_INS_SMULWB, 0x19D},
    {ARM_INS_SMULWT, 0x19E},
    {ARM_INS_SMUSD, 0x19F},
    {ARM_INS_SMUSDX, 0x1A0},
    {ARM_INS_SRSDA, 0x1A1},
    {ARM_INS_SRSDB, 0x1A2},
    {ARM_INS_SRSIA, 0x1A3},
    {ARM_INS_SRSIB, 0x1A4},
    {ARM_INS_SSAT, 0x1A5},
    {ARM_INS_SSAT16, 0x1A6},
    {ARM_INS_SSAX, 0x1A7},
    {ARM_INS_SSUB16, 0x1A8},
    {ARM_INS_SSUB8, 0x1A9},
    {ARM_INS_STC2L, 0x1AA},
    {ARM_INS_STC2, 0x1AB},
    {ARM_INS_STCL, 0x1AC},
    {ARM_INS_STC, 0x1AD},
    {ARM_INS_STL, 0x1AE},
    {ARM_INS_STLB, 0x1AF},
    {ARM_INS_STLEX, 0x1B0},
    {ARM_INS_STLEXB, 0x1B1},
    {ARM_INS_STLEXD, 0x1B2},
    {ARM_INS_STLEXH, 0x1B3},
    {ARM_INS_STLH, 0x1B4},
    {ARM_INS_STMDA, 0x1B5},
    {ARM_INS_STMDB, 0x1B6},
    {ARM_INS_STM, 0x1B7},
    {ARM_INS_STMIB, 0x1B8},
    {ARM_INS_STRB, 0x1B9},
    {ARM_INS_STRD, 0x1BA},
    {ARM_INS_STREX, 0x1BB},
    {ARM_INS_STREXB, 0x1BC},
    {ARM_INS_STREXD, 0x1BD},
    {ARM_INS_STREXH, 0x1BE},
    {ARM_INS_STRH, 0x1BF},
    {ARM_INS_STRHT, 0x1C0},
    {ARM_INS_SUB, 0x1C1},
    {ARM_INS_SVC, 0x1C2},
    {ARM_INS_SWP, 0x1C3},
    {ARM_INS_SWPB, 0x1C4},
    {ARM_INS_SXTAB, 0x1C5},
    {ARM_INS_SXTAB16, 0x1C6},
    {ARM_INS_SXTAH, 0x1C7},
    {ARM_INS_SXTB, 0x1C8},
    {ARM_INS_SXTB16, 0x1C9},
    {ARM_INS_SXTH, 0x1CA},
    {ARM_INS_TEQ, 0x1CB},
    {ARM_INS_TRAP, 0x1CC},
    {ARM_INS_TSB, 0x1CD},
    {ARM_INS_TST, 0x1CE},
    {ARM_INS_UADD16, 0x1CF},
    {ARM_INS_UADD8, 0x1D0},
    {ARM_INS_UASX, 0x1D1},
    {ARM_INS_UBFX, 0x1D2},
    {ARM_INS_UDF, 0x1D3},
    {ARM_INS_UDIV, 0x1D4},
    {ARM_INS_UHADD16, 0x1D5},
    {ARM_INS_UHADD8, 0x1D6},
    {ARM_INS_UHASX, 0x1D7},
    {ARM_INS_UHSAX, 0x1D8},
    {ARM_INS_UHSUB16, 0x1D9},
    {ARM_INS_UHSUB8, 0x1DA},
    {ARM_INS_UMAAL, 0x1DB},
    {ARM_INS_UMLAL, 0x1DC},
    {ARM_INS_UMULL, 0x1DD},
    {ARM_INS_UQADD16, 0x1DE},
    {ARM_INS_UQADD8, 0x1DF},
    {ARM_INS_UQASX, 0x1E0},
    {ARM_INS_UQSAX, 0x1E1},
    {ARM_INS_UQSUB16, 0x1E2},
    {ARM_INS_UQSUB8, 0x1E3},
    {ARM_INS_USAD8, 0x1E4},
    {ARM_INS_USADA8, 0x1E5},
    {ARM_INS_USAT, 0x1E6},
    {ARM_INS_USAT16, 0x1E7},
    {ARM_INS_USAX, 0x1E8},
    {ARM_INS_USUB16, 0x1E9},
    {ARM_INS_USUB8, 0x1EA},
    {ARM_INS_UXTAB, 0x1EB},
    {ARM_INS_UXTAB16, 0x1EC},
    {ARM_INS_UXTAH, 0x1ED},
    {ARM_INS_UXTB, 0x1EE},
    {ARM_INS_UXTB16, 0x1EF},
    {ARM_INS_UXTH, 0x1F0},
    {ARM_INS_VABAL, 0x1F1},
    {ARM_INS_VABA, 0x1F2},
    {ARM_INS_VABDL, 0x1F3},
    {ARM_INS_VACGE, 0x1F4},
    {ARM_INS_VACGT, 0x1F5},
    {ARM_INS_VADDHN, 0x1F6},
    {ARM_INS_VADDL, 0x1F7},
    {ARM_INS_VADDW, 0x1F8},
    {ARM_INS_VFMAB, 0x1F9},
    {ARM_INS_VFMAT, 0x1FA},
    {ARM_INS_VBIF, 0x1FB},
    {ARM_INS_VBIT, 0x1FC},
    {ARM_INS_VBSL, 0x1FD},
    {ARM_INS_VCEQ, 0x1FE},
    {ARM_INS_VCGE, 0x1FF},
    {ARM_INS_VCGT, 0x200},
    {ARM_INS_VCLE, 0x201},
    {ARM_INS_VCLT, 0x202},
    {ARM_INS_VCMPE, 0x203},
    {ARM_INS_VCNT, 0x204},
    {ARM_INS_VDIV, 0x205},
    {ARM_INS_VEXT, 0x206},
    {ARM_INS_VFMAL, 0x207},
    {ARM_INS_VFMSL, 0x208},
    {ARM_INS_VFNMA, 0x209},
    {ARM_INS_VFNMS, 0x20A},
    {ARM_INS_VINS, 0x20B},
    {ARM_INS_VJCVT, 0x20C},
    {ARM_INS_VLDMDB, 0x20D},
    {ARM_INS_VLDMIA, 0x20E},
    {ARM_INS_VLDR, 0x20F},
    {ARM_INS_VLLDM, 0x210},
    {ARM_INS_VLSTM, 0x211},
    {ARM_INS_VMLAL, 0x212},
    {ARM_INS_VMLS, 0x213},
    {ARM_INS_VMLSL, 0x214},
    {ARM_INS_VMMLA, 0x215},
    {ARM_INS_VMOVX, 0x216},
    {ARM_INS_VMOVL, 0x217},
    {ARM_INS_VMOVN, 0x218},
    {ARM_INS_VMSR, 0x219},
    {ARM_INS_VMULL, 0x21A},
    {ARM_INS_VNMLA, 0x21B},
    {ARM_INS_VNMLS, 0x21C},
    {ARM_INS_VNMUL, 0x21D},
    {ARM_INS_VPADAL, 0x21E},
    {ARM_INS_VPADDL, 0x21F},
    {ARM_INS_VPADD, 0x220},
    {ARM_INS_VPMAX, 0x221},
    {ARM_INS_VPMIN, 0x222},
    {ARM_INS_VQDMLAL, 0x223},
    {ARM_INS_VQDMLSL, 0x224},
    {ARM_INS_VQDMULL, 0x225},
    {ARM_INS_VQMOVUN, 0x226},
    {ARM_INS_VQMOVN, 0x227},
    {ARM_INS_VQRDMLSH, 0x228},
    {ARM_INS_VQRSHRN, 0x229},
    {ARM_INS_VQRSHRUN, 0x22A},
    {ARM_INS_VQSHRN, 0x22B},
    {ARM_INS_VQSHRUN, 0x22C},
    {ARM_INS_VRADDHN, 0x22D},
    {ARM_INS_VRECPE, 0x22E},
    {ARM_INS_VRECPS, 0x22F},
    {ARM_INS_VRINTR, 0x230},
    {ARM_INS_VRSHRN, 0x231},
    {ARM_INS_VRSQRTE, 0x232},
    {ARM_INS_VRSQRTS, 0x233},
    {ARM_INS_VRSRA, 0x234},
    {ARM_INS_VRSUBHN, 0x235},
    {ARM_INS_VSCCLRM, 0x236},
    {ARM_INS_VSDOT, 0x237},
    {ARM_INS_VSELEQ, 0x238},
    {ARM_INS_VSELGE, 0x239},
    {ARM_INS_VSELGT, 0x23A},
    {ARM_INS_VSELVS, 0x23B},
    {ARM_INS_VSHLL, 0x23C},
    {ARM_INS_VSHRN, 0x23D},
    {ARM_INS_VSMMLA, 0x23E},
    {ARM_INS_VSQRT, 0x23F},
    {ARM_INS_VSRA, 0x240},
    {ARM_INS_VSTMDB, 0x241},
    {ARM_INS_VSTMIA, 0x242},
    {ARM_INS_VSTR, 0x243},
    {ARM_INS_VSUBHN, 0x244},
    {ARM_INS_VSUBL, 0x245},
    {ARM_INS_VSUBW, 0x246},
    {ARM_INS_VSUDOT, 0x247},
    {ARM_INS_VSWP, 0x248},
    {ARM_INS_VTBL, 0x249},
    {ARM_INS_VTBX, 0x24A},
    {ARM_INS_VCVTR, 0x24B},
    {ARM_INS_VTRN, 0x24C},
    {ARM_INS_VTST, 0x24D},
    {ARM_INS_VUDOT, 0x24E},
    {ARM_INS_VUMMLA, 0x24F},
    {ARM_INS_VUSDOT, 0x250},
    {ARM_INS_VUSMMLA, 0x251},
    {ARM_INS_VUZP, 0x252},
    {ARM_INS_VZIP, 0x253},
    {ARM_INS_ADDW, 0x254},
    {ARM_INS_AUT, 0x255},
    {ARM_INS_AUTG, 0x256},
    {ARM_INS_BFL, 0x257},
    {ARM_INS_BFLX, 0x258},
    {ARM_INS_BF, 0x259},
    {ARM_INS_BFCSEL, 0x25A},
    {ARM_INS_BFX, 0x25B},
    {ARM_INS_BTI, 0x25C},
    {ARM_INS_BXAUT, 0x25D},
    {ARM_INS_CLRM, 0x25E},
    {ARM_INS_CSEL, 0x25F},
    {ARM_INS_CSINC, 0x260},
    {ARM_INS_CSINV, 0x261},
    {ARM_INS_CSNEG, 0x262},
    {ARM_INS_DCPS1, 0x263},
    {ARM_INS_DCPS2, 0x264},
    {ARM_INS_DCPS3, 0x265},
    {ARM_INS_DLS, 0x266},
    {ARM_INS_LE, 0x267},
    {ARM_INS_ORN, 0x268},
    {ARM_INS_PAC, 0x269},
    {ARM_INS_PACBTI, 0x26A},
    {ARM_INS_PACG, 0x26B},
    {ARM_INS_SG, 0x26C},
    {ARM_INS_SUBS, 0x26D},
    {ARM_INS_SUBW, 0x26E},
    {ARM_INS_TBB, 0x26F},
    {ARM_INS_TBH, 0x270},
    {ARM_INS_TT, 0x271},
    {ARM_INS_TTA, 0x272},
    {ARM_INS_TTAT, 0x273},
    {ARM_INS_TTT, 0x274},
    {ARM_INS_WLS, 0x275},
    {ARM_INS_BLXNS, 0x276},
    {ARM_INS_BXNS, 0x277},
    {ARM_INS_CBNZ, 0x278},
    {ARM_INS_CBZ, 0x279},
    {ARM_INS_POP, 0x27A},
    {ARM_INS_PUSH, 0x27B},
    {ARM_INS___BRKDIV0, 0x27C},
    {ARM_INS_VPOP, 0x27D},
    {ARM_INS_VPUSH, 0x27E},
};

const int ninst = sizeof(opcode_index_tab) / sizeof (op_index_pair_t);

resolver_func inst_resolver[] = {
    &invalid_resolver,
    &asr_resolver,
    &it_resolver,
    &ldrbt_resolver,
    &ldr_resolver,
    &ldrht_resolver,
    &ldrsbt_resolver,
    &ldrsht_resolver,
    &ldrt_resolver,
    &lsl_resolver,
    &lsr_resolver,
    &ror_resolver,
    &rrx_resolver,
    &strbt_resolver,
    &strt_resolver,
    &vld1_resolver,
    &vld2_resolver,
    &vld3_resolver,
    &vld4_resolver,
    &vst1_resolver,
    &vst2_resolver,
    &vst3_resolver,
    &vst4_resolver,
    &ldrb_resolver,
    &ldrh_resolver,
    &ldrsb_resolver,
    &ldrsh_resolver,
    &movs_resolver,
    &mov_resolver,
    &str_resolver,
    &adc_resolver,
    &add_resolver,
    &adr_resolver,
    &aesd_resolver,
    &aese_resolver,
    &aesimc_resolver,
    &aesmc_resolver,
    &and_resolver,
    &vdot_resolver,
    &vcvt_resolver,
    &vcvtb_resolver,
    &vcvtt_resolver,
    &bfc_resolver,
    &bfi_resolver,
    &bic_resolver,
    &bkpt_resolver,
    &bl_resolver,
    &blx_resolver,
    &bx_resolver,
    &bxj_resolver,
    &b_resolver,
    &cx1_resolver,
    &cx1a_resolver,
    &cx1d_resolver,
    &cx1da_resolver,
    &cx2_resolver,
    &cx2a_resolver,
    &cx2d_resolver,
    &cx2da_resolver,
    &cx3_resolver,
    &cx3a_resolver,
    &cx3d_resolver,
    &cx3da_resolver,
    &vcx1a_resolver,
    &vcx1_resolver,
    &vcx2a_resolver,
    &vcx2_resolver,
    &vcx3a_resolver,
    &vcx3_resolver,
    &cdp_resolver,
    &cdp2_resolver,
    &clrex_resolver,
    &clz_resolver,
    &cmn_resolver,
    &cmp_resolver,
    &cps_resolver,
    &crc32b_resolver,
    &crc32cb_resolver,
    &crc32ch_resolver,
    &crc32cw_resolver,
    &crc32h_resolver,
    &crc32w_resolver,
    &dbg_resolver,
    &dmb_resolver,
    &dsb_resolver,
    &eor_resolver,
    &eret_resolver,
    &vmov_resolver,
    &fldmdbx_resolver,
    &fldmiax_resolver,
    &vmrs_resolver,
    &fstmdbx_resolver,
    &fstmiax_resolver,
    &hint_resolver,
    &hlt_resolver,
    &hvc_resolver,
    &isb_resolver,
    &lda_resolver,
    &ldab_resolver,
    &ldaex_resolver,
    &ldaexb_resolver,
    &ldaexd_resolver,
    &ldaexh_resolver,
    &ldah_resolver,
    &ldc2l_resolver,
    &ldc2_resolver,
    &ldcl_resolver,
    &ldc_resolver,
    &ldmda_resolver,
    &ldmdb_resolver,
    &ldm_resolver,
    &ldmib_resolver,
    &ldrd_resolver,
    &ldrex_resolver,
    &ldrexb_resolver,
    &ldrexd_resolver,
    &ldrexh_resolver,
    &mcr_resolver,
    &mcr2_resolver,
    &mcrr_resolver,
    &mcrr2_resolver,
    &mla_resolver,
    &mls_resolver,
    &movt_resolver,
    &movw_resolver,
    &mrc_resolver,
    &mrc2_resolver,
    &mrrc_resolver,
    &mrrc2_resolver,
    &mrs_resolver,
    &msr_resolver,
    &mul_resolver,
    &asrl_resolver,
    &dlstp_resolver,
    &lctp_resolver,
    &letp_resolver,
    &lsll_resolver,
    &lsrl_resolver,
    &sqrshr_resolver,
    &sqrshrl_resolver,
    &sqshl_resolver,
    &sqshll_resolver,
    &srshr_resolver,
    &srshrl_resolver,
    &uqrshl_resolver,
    &uqrshll_resolver,
    &uqshl_resolver,
    &uqshll_resolver,
    &urshr_resolver,
    &urshrl_resolver,
    &vabav_resolver,
    &vabd_resolver,
    &vabs_resolver,
    &vadc_resolver,
    &vadci_resolver,
    &vaddlva_resolver,
    &vaddlv_resolver,
    &vaddva_resolver,
    &vaddv_resolver,
    &vadd_resolver,
    &vand_resolver,
    &vbic_resolver,
    &vbrsr_resolver,
    &vcadd_resolver,
    &vcls_resolver,
    &vclz_resolver,
    &vcmla_resolver,
    &vcmp_resolver,
    &vcmul_resolver,
    &vctp_resolver,
    &vcvta_resolver,
    &vcvtm_resolver,
    &vcvtn_resolver,
    &vcvtp_resolver,
    &vddup_resolver,
    &vdup_resolver,
    &vdwdup_resolver,
    &veor_resolver,
    &vfmas_resolver,
    &vfma_resolver,
    &vfms_resolver,
    &vhadd_resolver,
    &vhcadd_resolver,
    &vhsub_resolver,
    &vidup_resolver,
    &viwdup_resolver,
    &vld20_resolver,
    &vld21_resolver,
    &vld40_resolver,
    &vld41_resolver,
    &vld42_resolver,
    &vld43_resolver,
    &vldrb_resolver,
    &vldrd_resolver,
    &vldrh_resolver,
    &vldrw_resolver,
    &vmaxav_resolver,
    &vmaxa_resolver,
    &vmaxnmav_resolver,
    &vmaxnma_resolver,
    &vmaxnmv_resolver,
    &vmaxnm_resolver,
    &vmaxv_resolver,
    &vmax_resolver,
    &vminav_resolver,
    &vmina_resolver,
    &vminnmav_resolver,
    &vminnma_resolver,
    &vminnmv_resolver,
    &vminnm_resolver,
    &vminv_resolver,
    &vmin_resolver,
    &vmladava_resolver,
    &vmladavax_resolver,
    &vmladav_resolver,
    &vmladavx_resolver,
    &vmlaldava_resolver,
    &vmlaldavax_resolver,
    &vmlaldav_resolver,
    &vmlaldavx_resolver,
    &vmlas_resolver,
    &vmla_resolver,
    &vmlsdava_resolver,
    &vmlsdavax_resolver,
    &vmlsdav_resolver,
    &vmlsdavx_resolver,
    &vmlsldava_resolver,
    &vmlsldavax_resolver,
    &vmlsldav_resolver,
    &vmlsldavx_resolver,
    &vmovlb_resolver,
    &vmovlt_resolver,
    &vmovnb_resolver,
    &vmovnt_resolver,
    &vmulh_resolver,
    &vmullb_resolver,
    &vmullt_resolver,
    &vmul_resolver,
    &vmvn_resolver,
    &vneg_resolver,
    &vorn_resolver,
    &vorr_resolver,
    &vpnot_resolver,
    &vpsel_resolver,
    &vpst_resolver,
    &vpt_resolver,
    &vqabs_resolver,
    &vqadd_resolver,
    &vqdmladhx_resolver,
    &vqdmladh_resolver,
    &vqdmlah_resolver,
    &vqdmlash_resolver,
    &vqdmlsdhx_resolver,
    &vqdmlsdh_resolver,
    &vqdmulh_resolver,
    &vqdmullb_resolver,
    &vqdmullt_resolver,
    &vqmovnb_resolver,
    &vqmovnt_resolver,
    &vqmovunb_resolver,
    &vqmovunt_resolver,
    &vqneg_resolver,
    &vqrdmladhx_resolver,
    &vqrdmladh_resolver,
    &vqrdmlah_resolver,
    &vqrdmlash_resolver,
    &vqrdmlsdhx_resolver,
    &vqrdmlsdh_resolver,
    &vqrdmulh_resolver,
    &vqrshl_resolver,
    &vqrshrnb_resolver,
    &vqrshrnt_resolver,
    &vqrshrunb_resolver,
    &vqrshrunt_resolver,
    &vqshlu_resolver,
    &vqshl_resolver,
    &vqshrnb_resolver,
    &vqshrnt_resolver,
    &vqshrunb_resolver,
    &vqshrunt_resolver,
    &vqsub_resolver,
    &vrev16_resolver,
    &vrev32_resolver,
    &vrev64_resolver,
    &vrhadd_resolver,
    &vrinta_resolver,
    &vrintm_resolver,
    &vrintn_resolver,
    &vrintp_resolver,
    &vrintx_resolver,
    &vrintz_resolver,
    &vrmlaldavha_resolver,
    &vrmlaldavhax_resolver,
    &vrmlaldavh_resolver,
    &vrmlaldavhx_resolver,
    &vrmlsldavha_resolver,
    &vrmlsldavhax_resolver,
    &vrmlsldavh_resolver,
    &vrmlsldavhx_resolver,
    &vrmulh_resolver,
    &vrshl_resolver,
    &vrshrnb_resolver,
    &vrshrnt_resolver,
    &vrshr_resolver,
    &vsbc_resolver,
    &vsbci_resolver,
    &vshlc_resolver,
    &vshllb_resolver,
    &vshllt_resolver,
    &vshl_resolver,
    &vshrnb_resolver,
    &vshrnt_resolver,
    &vshr_resolver,
    &vsli_resolver,
    &vsri_resolver,
    &vst20_resolver,
    &vst21_resolver,
    &vst40_resolver,
    &vst41_resolver,
    &vst42_resolver,
    &vst43_resolver,
    &vstrb_resolver,
    &vstrd_resolver,
    &vstrh_resolver,
    &vstrw_resolver,
    &vsub_resolver,
    &wlstp_resolver,
    &mvn_resolver,
    &orr_resolver,
    &pkhbt_resolver,
    &pkhtb_resolver,
    &pldw_resolver,
    &pld_resolver,
    &pli_resolver,
    &qadd_resolver,
    &qadd16_resolver,
    &qadd8_resolver,
    &qasx_resolver,
    &qdadd_resolver,
    &qdsub_resolver,
    &qsax_resolver,
    &qsub_resolver,
    &qsub16_resolver,
    &qsub8_resolver,
    &rbit_resolver,
    &rev_resolver,
    &rev16_resolver,
    &revsh_resolver,
    &rfeda_resolver,
    &rfedb_resolver,
    &rfeia_resolver,
    &rfeib_resolver,
    &rsb_resolver,
    &rsc_resolver,
    &sadd16_resolver,
    &sadd8_resolver,
    &sasx_resolver,
    &sb_resolver,
    &sbc_resolver,
    &sbfx_resolver,
    &sdiv_resolver,
    &sel_resolver,
    &setend_resolver,
    &setpan_resolver,
    &sha1c_resolver,
    &sha1h_resolver,
    &sha1m_resolver,
    &sha1p_resolver,
    &sha1su0_resolver,
    &sha1su1_resolver,
    &sha256h_resolver,
    &sha256h2_resolver,
    &sha256su0_resolver,
    &sha256su1_resolver,
    &shadd16_resolver,
    &shadd8_resolver,
    &shasx_resolver,
    &shsax_resolver,
    &shsub16_resolver,
    &shsub8_resolver,
    &smc_resolver,
    &smlabb_resolver,
    &smlabt_resolver,
    &smlad_resolver,
    &smladx_resolver,
    &smlal_resolver,
    &smlalbb_resolver,
    &smlalbt_resolver,
    &smlald_resolver,
    &smlaldx_resolver,
    &smlaltb_resolver,
    &smlaltt_resolver,
    &smlatb_resolver,
    &smlatt_resolver,
    &smlawb_resolver,
    &smlawt_resolver,
    &smlsd_resolver,
    &smlsdx_resolver,
    &smlsld_resolver,
    &smlsldx_resolver,
    &smmla_resolver,
    &smmlar_resolver,
    &smmls_resolver,
    &smmlsr_resolver,
    &smmul_resolver,
    &smmulr_resolver,
    &smuad_resolver,
    &smuadx_resolver,
    &smulbb_resolver,
    &smulbt_resolver,
    &smull_resolver,
    &smultb_resolver,
    &smultt_resolver,
    &smulwb_resolver,
    &smulwt_resolver,
    &smusd_resolver,
    &smusdx_resolver,
    &srsda_resolver,
    &srsdb_resolver,
    &srsia_resolver,
    &srsib_resolver,
    &ssat_resolver,
    &ssat16_resolver,
    &ssax_resolver,
    &ssub16_resolver,
    &ssub8_resolver,
    &stc2l_resolver,
    &stc2_resolver,
    &stcl_resolver,
    &stc_resolver,
    &stl_resolver,
    &stlb_resolver,
    &stlex_resolver,
    &stlexb_resolver,
    &stlexd_resolver,
    &stlexh_resolver,
    &stlh_resolver,
    &stmda_resolver,
    &stmdb_resolver,
    &stm_resolver,
    &stmib_resolver,
    &strb_resolver,
    &strd_resolver,
    &strex_resolver,
    &strexb_resolver,
    &strexd_resolver,
    &strexh_resolver,
    &strh_resolver,
    &strht_resolver,
    &sub_resolver,
    &svc_resolver,
    &swp_resolver,
    &swpb_resolver,
    &sxtab_resolver,
    &sxtab16_resolver,
    &sxtah_resolver,
    &sxtb_resolver,
    &sxtb16_resolver,
    &sxth_resolver,
    &teq_resolver,
    &trap_resolver,
    &tsb_resolver,
    &tst_resolver,
    &uadd16_resolver,
    &uadd8_resolver,
    &uasx_resolver,
    &ubfx_resolver,
    &udf_resolver,
    &udiv_resolver,
    &uhadd16_resolver,
    &uhadd8_resolver,
    &uhasx_resolver,
    &uhsax_resolver,
    &uhsub16_resolver,
    &uhsub8_resolver,
    &umaal_resolver,
    &umlal_resolver,
    &umull_resolver,
    &uqadd16_resolver,
    &uqadd8_resolver,
    &uqasx_resolver,
    &uqsax_resolver,
    &uqsub16_resolver,
    &uqsub8_resolver,
    &usad8_resolver,
    &usada8_resolver,
    &usat_resolver,
    &usat16_resolver,
    &usax_resolver,
    &usub16_resolver,
    &usub8_resolver,
    &uxtab_resolver,
    &uxtab16_resolver,
    &uxtah_resolver,
    &uxtb_resolver,
    &uxtb16_resolver,
    &uxth_resolver,
    &vabal_resolver,
    &vaba_resolver,
    &vabdl_resolver,
    &vacge_resolver,
    &vacgt_resolver,
    &vaddhn_resolver,
    &vaddl_resolver,
    &vaddw_resolver,
    &vfmab_resolver,
    &vfmat_resolver,
    &vbif_resolver,
    &vbit_resolver,
    &vbsl_resolver,
    &vceq_resolver,
    &vcge_resolver,
    &vcgt_resolver,
    &vcle_resolver,
    &vclt_resolver,
    &vcmpe_resolver,
    &vcnt_resolver,
    &vdiv_resolver,
    &vext_resolver,
    &vfmal_resolver,
    &vfmsl_resolver,
    &vfnma_resolver,
    &vfnms_resolver,
    &vins_resolver,
    &vjcvt_resolver,
    &vldmdb_resolver,
    &vldmia_resolver,
    &vldr_resolver,
    &vlldm_resolver,
    &vlstm_resolver,
    &vmlal_resolver,
    &vmls_resolver,
    &vmlsl_resolver,
    &vmmla_resolver,
    &vmovx_resolver,
    &vmovl_resolver,
    &vmovn_resolver,
    &vmsr_resolver,
    &vmull_resolver,
    &vnmla_resolver,
    &vnmls_resolver,
    &vnmul_resolver,
    &vpadal_resolver,
    &vpaddl_resolver,
    &vpadd_resolver,
    &vpmax_resolver,
    &vpmin_resolver,
    &vqdmlal_resolver,
    &vqdmlsl_resolver,
    &vqdmull_resolver,
    &vqmovun_resolver,
    &vqmovn_resolver,
    &vqrdmlsh_resolver,
    &vqrshrn_resolver,
    &vqrshrun_resolver,
    &vqshrn_resolver,
    &vqshrun_resolver,
    &vraddhn_resolver,
    &vrecpe_resolver,
    &vrecps_resolver,
    &vrintr_resolver,
    &vrshrn_resolver,
    &vrsqrte_resolver,
    &vrsqrts_resolver,
    &vrsra_resolver,
    &vrsubhn_resolver,
    &vscclrm_resolver,
    &vsdot_resolver,
    &vseleq_resolver,
    &vselge_resolver,
    &vselgt_resolver,
    &vselvs_resolver,
    &vshll_resolver,
    &vshrn_resolver,
    &vsmmla_resolver,
    &vsqrt_resolver,
    &vsra_resolver,
    &vstmdb_resolver,
    &vstmia_resolver,
    &vstr_resolver,
    &vsubhn_resolver,
    &vsubl_resolver,
    &vsubw_resolver,
    &vsudot_resolver,
    &vswp_resolver,
    &vtbl_resolver,
    &vtbx_resolver,
    &vcvtr_resolver,
    &vtrn_resolver,
    &vtst_resolver,
    &vudot_resolver,
    &vummla_resolver,
    &vusdot_resolver,
    &vusmmla_resolver,
    &vuzp_resolver,
    &vzip_resolver,
    &addw_resolver,
    &aut_resolver,
    &autg_resolver,
    &bfl_resolver,
    &bflx_resolver,
    &bf_resolver,
    &bfcsel_resolver,
    &bfx_resolver,
    &bti_resolver,
    &bxaut_resolver,
    &clrm_resolver,
    &csel_resolver,
    &csinc_resolver,
    &csinv_resolver,
    &csneg_resolver,
    &dcps1_resolver,
    &dcps2_resolver,
    &dcps3_resolver,
    &dls_resolver,
    &le_resolver,
    &orn_resolver,
    &pac_resolver,
    &pacbti_resolver,
    &pacg_resolver,
    &sg_resolver,
    &subs_resolver,
    &subw_resolver,
    &tbb_resolver,
    &tbh_resolver,
    &tt_resolver,
    &tta_resolver,
    &ttat_resolver,
    &ttt_resolver,
    &wls_resolver,
    &blxns_resolver,
    &bxns_resolver,
    &cbnz_resolver,
    &cbz_resolver,
    &pop_resolver,
    &push_resolver,
    &brkdiv0_resolver,
    &vpop_resolver,
    &vpush_resolver,
};


post_resolve_heuristic_func post_resolve_heuristics[] = {
    &invalid_post_res,
    &asr_post_res,
    &it_post_res,
    &ldrbt_post_res,
    &ldr_post_res,
    &ldrht_post_res,
    &ldrsbt_post_res,
    &ldrsht_post_res,
    &ldrt_post_res,
    &lsl_post_res,
    &lsr_post_res,
    &ror_post_res,
    &rrx_post_res,
    &strbt_post_res,
    &strt_post_res,
    &vld1_post_res,
    &vld2_post_res,
    &vld3_post_res,
    &vld4_post_res,
    &vst1_post_res,
    &vst2_post_res,
    &vst3_post_res,
    &vst4_post_res,
    &ldrb_post_res,
    &ldrh_post_res,
    &ldrsb_post_res,
    &ldrsh_post_res,
    &movs_post_res,
    &mov_post_res,
    &str_post_res,
    &adc_post_res,
    &add_post_res,
    &adr_post_res,
    &aesd_post_res,
    &aese_post_res,
    &aesimc_post_res,
    &aesmc_post_res,
    &and_post_res,
    &vdot_post_res,
    &vcvt_post_res,
    &vcvtb_post_res,
    &vcvtt_post_res,
    &bfc_post_res,
    &bfi_post_res,
    &bic_post_res,
    &bkpt_post_res,
    &bl_post_res,
    &blx_post_res,
    &bx_post_res,
    &bxj_post_res,
    &b_post_res,
    &cx1_post_res,
    &cx1a_post_res,
    &cx1d_post_res,
    &cx1da_post_res,
    &cx2_post_res,
    &cx2a_post_res,
    &cx2d_post_res,
    &cx2da_post_res,
    &cx3_post_res,
    &cx3a_post_res,
    &cx3d_post_res,
    &cx3da_post_res,
    &vcx1a_post_res,
    &vcx1_post_res,
    &vcx2a_post_res,
    &vcx2_post_res,
    &vcx3a_post_res,
    &vcx3_post_res,
    &cdp_post_res,
    &cdp2_post_res,
    &clrex_post_res,
    &clz_post_res,
    &cmn_post_res,
    &cmp_post_res,
    &cps_post_res,
    &crc32b_post_res,
    &crc32cb_post_res,
    &crc32ch_post_res,
    &crc32cw_post_res,
    &crc32h_post_res,
    &crc32w_post_res,
    &dbg_post_res,
    &dmb_post_res,
    &dsb_post_res,
    &eor_post_res,
    &eret_post_res,
    &vmov_post_res,
    &fldmdbx_post_res,
    &fldmiax_post_res,
    &vmrs_post_res,
    &fstmdbx_post_res,
    &fstmiax_post_res,
    &hint_post_res,
    &hlt_post_res,
    &hvc_post_res,
    &isb_post_res,
    &lda_post_res,
    &ldab_post_res,
    &ldaex_post_res,
    &ldaexb_post_res,
    &ldaexd_post_res,
    &ldaexh_post_res,
    &ldah_post_res,
    &ldc2l_post_res,
    &ldc2_post_res,
    &ldcl_post_res,
    &ldc_post_res,
    &ldmda_post_res,
    &ldmdb_post_res,
    &ldm_post_res,
    &ldmib_post_res,
    &ldrd_post_res,
    &ldrex_post_res,
    &ldrexb_post_res,
    &ldrexd_post_res,
    &ldrexh_post_res,
    &mcr_post_res,
    &mcr2_post_res,
    &mcrr_post_res,
    &mcrr2_post_res,
    &mla_post_res,
    &mls_post_res,
    &movt_post_res,
    &movw_post_res,
    &mrc_post_res,
    &mrc2_post_res,
    &mrrc_post_res,
    &mrrc2_post_res,
    &mrs_post_res,
    &msr_post_res,
    &mul_post_res,
    &asrl_post_res,
    &dlstp_post_res,
    &lctp_post_res,
    &letp_post_res,
    &lsll_post_res,
    &lsrl_post_res,
    &sqrshr_post_res,
    &sqrshrl_post_res,
    &sqshl_post_res,
    &sqshll_post_res,
    &srshr_post_res,
    &srshrl_post_res,
    &uqrshl_post_res,
    &uqrshll_post_res,
    &uqshl_post_res,
    &uqshll_post_res,
    &urshr_post_res,
    &urshrl_post_res,
    &vabav_post_res,
    &vabd_post_res,
    &vabs_post_res,
    &vadc_post_res,
    &vadci_post_res,
    &vaddlva_post_res,
    &vaddlv_post_res,
    &vaddva_post_res,
    &vaddv_post_res,
    &vadd_post_res,
    &vand_post_res,
    &vbic_post_res,
    &vbrsr_post_res,
    &vcadd_post_res,
    &vcls_post_res,
    &vclz_post_res,
    &vcmla_post_res,
    &vcmp_post_res,
    &vcmul_post_res,
    &vctp_post_res,
    &vcvta_post_res,
    &vcvtm_post_res,
    &vcvtn_post_res,
    &vcvtp_post_res,
    &vddup_post_res,
    &vdup_post_res,
    &vdwdup_post_res,
    &veor_post_res,
    &vfmas_post_res,
    &vfma_post_res,
    &vfms_post_res,
    &vhadd_post_res,
    &vhcadd_post_res,
    &vhsub_post_res,
    &vidup_post_res,
    &viwdup_post_res,
    &vld20_post_res,
    &vld21_post_res,
    &vld40_post_res,
    &vld41_post_res,
    &vld42_post_res,
    &vld43_post_res,
    &vldrb_post_res,
    &vldrd_post_res,
    &vldrh_post_res,
    &vldrw_post_res,
    &vmaxav_post_res,
    &vmaxa_post_res,
    &vmaxnmav_post_res,
    &vmaxnma_post_res,
    &vmaxnmv_post_res,
    &vmaxnm_post_res,
    &vmaxv_post_res,
    &vmax_post_res,
    &vminav_post_res,
    &vmina_post_res,
    &vminnmav_post_res,
    &vminnma_post_res,
    &vminnmv_post_res,
    &vminnm_post_res,
    &vminv_post_res,
    &vmin_post_res,
    &vmladava_post_res,
    &vmladavax_post_res,
    &vmladav_post_res,
    &vmladavx_post_res,
    &vmlaldava_post_res,
    &vmlaldavax_post_res,
    &vmlaldav_post_res,
    &vmlaldavx_post_res,
    &vmlas_post_res,
    &vmla_post_res,
    &vmlsdava_post_res,
    &vmlsdavax_post_res,
    &vmlsdav_post_res,
    &vmlsdavx_post_res,
    &vmlsldava_post_res,
    &vmlsldavax_post_res,
    &vmlsldav_post_res,
    &vmlsldavx_post_res,
    &vmovlb_post_res,
    &vmovlt_post_res,
    &vmovnb_post_res,
    &vmovnt_post_res,
    &vmulh_post_res,
    &vmullb_post_res,
    &vmullt_post_res,
    &vmul_post_res,
    &vmvn_post_res,
    &vneg_post_res,
    &vorn_post_res,
    &vorr_post_res,
    &vpnot_post_res,
    &vpsel_post_res,
    &vpst_post_res,
    &vpt_post_res,
    &vqabs_post_res,
    &vqadd_post_res,
    &vqdmladhx_post_res,
    &vqdmladh_post_res,
    &vqdmlah_post_res,
    &vqdmlash_post_res,
    &vqdmlsdhx_post_res,
    &vqdmlsdh_post_res,
    &vqdmulh_post_res,
    &vqdmullb_post_res,
    &vqdmullt_post_res,
    &vqmovnb_post_res,
    &vqmovnt_post_res,
    &vqmovunb_post_res,
    &vqmovunt_post_res,
    &vqneg_post_res,
    &vqrdmladhx_post_res,
    &vqrdmladh_post_res,
    &vqrdmlah_post_res,
    &vqrdmlash_post_res,
    &vqrdmlsdhx_post_res,
    &vqrdmlsdh_post_res,
    &vqrdmulh_post_res,
    &vqrshl_post_res,
    &vqrshrnb_post_res,
    &vqrshrnt_post_res,
    &vqrshrunb_post_res,
    &vqrshrunt_post_res,
    &vqshlu_post_res,
    &vqshl_post_res,
    &vqshrnb_post_res,
    &vqshrnt_post_res,
    &vqshrunb_post_res,
    &vqshrunt_post_res,
    &vqsub_post_res,
    &vrev16_post_res,
    &vrev32_post_res,
    &vrev64_post_res,
    &vrhadd_post_res,
    &vrinta_post_res,
    &vrintm_post_res,
    &vrintn_post_res,
    &vrintp_post_res,
    &vrintx_post_res,
    &vrintz_post_res,
    &vrmlaldavha_post_res,
    &vrmlaldavhax_post_res,
    &vrmlaldavh_post_res,
    &vrmlaldavhx_post_res,
    &vrmlsldavha_post_res,
    &vrmlsldavhax_post_res,
    &vrmlsldavh_post_res,
    &vrmlsldavhx_post_res,
    &vrmulh_post_res,
    &vrshl_post_res,
    &vrshrnb_post_res,
    &vrshrnt_post_res,
    &vrshr_post_res,
    &vsbc_post_res,
    &vsbci_post_res,
    &vshlc_post_res,
    &vshllb_post_res,
    &vshllt_post_res,
    &vshl_post_res,
    &vshrnb_post_res,
    &vshrnt_post_res,
    &vshr_post_res,
    &vsli_post_res,
    &vsri_post_res,
    &vst20_post_res,
    &vst21_post_res,
    &vst40_post_res,
    &vst41_post_res,
    &vst42_post_res,
    &vst43_post_res,
    &vstrb_post_res,
    &vstrd_post_res,
    &vstrh_post_res,
    &vstrw_post_res,
    &vsub_post_res,
    &wlstp_post_res,
    &mvn_post_res,
    &orr_post_res,
    &pkhbt_post_res,
    &pkhtb_post_res,
    &pldw_post_res,
    &pld_post_res,
    &pli_post_res,
    &qadd_post_res,
    &qadd16_post_res,
    &qadd8_post_res,
    &qasx_post_res,
    &qdadd_post_res,
    &qdsub_post_res,
    &qsax_post_res,
    &qsub_post_res,
    &qsub16_post_res,
    &qsub8_post_res,
    &rbit_post_res,
    &rev_post_res,
    &rev16_post_res,
    &revsh_post_res,
    &rfeda_post_res,
    &rfedb_post_res,
    &rfeia_post_res,
    &rfeib_post_res,
    &rsb_post_res,
    &rsc_post_res,
    &sadd16_post_res,
    &sadd8_post_res,
    &sasx_post_res,
    &sb_post_res,
    &sbc_post_res,
    &sbfx_post_res,
    &sdiv_post_res,
    &sel_post_res,
    &setend_post_res,
    &setpan_post_res,
    &sha1c_post_res,
    &sha1h_post_res,
    &sha1m_post_res,
    &sha1p_post_res,
    &sha1su0_post_res,
    &sha1su1_post_res,
    &sha256h_post_res,
    &sha256h2_post_res,
    &sha256su0_post_res,
    &sha256su1_post_res,
    &shadd16_post_res,
    &shadd8_post_res,
    &shasx_post_res,
    &shsax_post_res,
    &shsub16_post_res,
    &shsub8_post_res,
    &smc_post_res,
    &smlabb_post_res,
    &smlabt_post_res,
    &smlad_post_res,
    &smladx_post_res,
    &smlal_post_res,
    &smlalbb_post_res,
    &smlalbt_post_res,
    &smlald_post_res,
    &smlaldx_post_res,
    &smlaltb_post_res,
    &smlaltt_post_res,
    &smlatb_post_res,
    &smlatt_post_res,
    &smlawb_post_res,
    &smlawt_post_res,
    &smlsd_post_res,
    &smlsdx_post_res,
    &smlsld_post_res,
    &smlsldx_post_res,
    &smmla_post_res,
    &smmlar_post_res,
    &smmls_post_res,
    &smmlsr_post_res,
    &smmul_post_res,
    &smmulr_post_res,
    &smuad_post_res,
    &smuadx_post_res,
    &smulbb_post_res,
    &smulbt_post_res,
    &smull_post_res,
    &smultb_post_res,
    &smultt_post_res,
    &smulwb_post_res,
    &smulwt_post_res,
    &smusd_post_res,
    &smusdx_post_res,
    &srsda_post_res,
    &srsdb_post_res,
    &srsia_post_res,
    &srsib_post_res,
    &ssat_post_res,
    &ssat16_post_res,
    &ssax_post_res,
    &ssub16_post_res,
    &ssub8_post_res,
    &stc2l_post_res,
    &stc2_post_res,
    &stcl_post_res,
    &stc_post_res,
    &stl_post_res,
    &stlb_post_res,
    &stlex_post_res,
    &stlexb_post_res,
    &stlexd_post_res,
    &stlexh_post_res,
    &stlh_post_res,
    &stmda_post_res,
    &stmdb_post_res,
    &stm_post_res,
    &stmib_post_res,
    &strb_post_res,
    &strd_post_res,
    &strex_post_res,
    &strexb_post_res,
    &strexd_post_res,
    &strexh_post_res,
    &strh_post_res,
    &strht_post_res,
    &sub_post_res,
    &svc_post_res,
    &swp_post_res,
    &swpb_post_res,
    &sxtab_post_res,
    &sxtab16_post_res,
    &sxtah_post_res,
    &sxtb_post_res,
    &sxtb16_post_res,
    &sxth_post_res,
    &teq_post_res,
    &trap_post_res,
    &tsb_post_res,
    &tst_post_res,
    &uadd16_post_res,
    &uadd8_post_res,
    &uasx_post_res,
    &ubfx_post_res,
    &udf_post_res,
    &udiv_post_res,
    &uhadd16_post_res,
    &uhadd8_post_res,
    &uhasx_post_res,
    &uhsax_post_res,
    &uhsub16_post_res,
    &uhsub8_post_res,
    &umaal_post_res,
    &umlal_post_res,
    &umull_post_res,
    &uqadd16_post_res,
    &uqadd8_post_res,
    &uqasx_post_res,
    &uqsax_post_res,
    &uqsub16_post_res,
    &uqsub8_post_res,
    &usad8_post_res,
    &usada8_post_res,
    &usat_post_res,
    &usat16_post_res,
    &usax_post_res,
    &usub16_post_res,
    &usub8_post_res,
    &uxtab_post_res,
    &uxtab16_post_res,
    &uxtah_post_res,
    &uxtb_post_res,
    &uxtb16_post_res,
    &uxth_post_res,
    &vabal_post_res,
    &vaba_post_res,
    &vabdl_post_res,
    &vacge_post_res,
    &vacgt_post_res,
    &vaddhn_post_res,
    &vaddl_post_res,
    &vaddw_post_res,
    &vfmab_post_res,
    &vfmat_post_res,
    &vbif_post_res,
    &vbit_post_res,
    &vbsl_post_res,
    &vceq_post_res,
    &vcge_post_res,
    &vcgt_post_res,
    &vcle_post_res,
    &vclt_post_res,
    &vcmpe_post_res,
    &vcnt_post_res,
    &vdiv_post_res,
    &vext_post_res,
    &vfmal_post_res,
    &vfmsl_post_res,
    &vfnma_post_res,
    &vfnms_post_res,
    &vins_post_res,
    &vjcvt_post_res,
    &vldmdb_post_res,
    &vldmia_post_res,
    &vldr_post_res,
    &vlldm_post_res,
    &vlstm_post_res,
    &vmlal_post_res,
    &vmls_post_res,
    &vmlsl_post_res,
    &vmmla_post_res,
    &vmovx_post_res,
    &vmovl_post_res,
    &vmovn_post_res,
    &vmsr_post_res,
    &vmull_post_res,
    &vnmla_post_res,
    &vnmls_post_res,
    &vnmul_post_res,
    &vpadal_post_res,
    &vpaddl_post_res,
    &vpadd_post_res,
    &vpmax_post_res,
    &vpmin_post_res,
    &vqdmlal_post_res,
    &vqdmlsl_post_res,
    &vqdmull_post_res,
    &vqmovun_post_res,
    &vqmovn_post_res,
    &vqrdmlsh_post_res,
    &vqrshrn_post_res,
    &vqrshrun_post_res,
    &vqshrn_post_res,
    &vqshrun_post_res,
    &vraddhn_post_res,
    &vrecpe_post_res,
    &vrecps_post_res,
    &vrintr_post_res,
    &vrshrn_post_res,
    &vrsqrte_post_res,
    &vrsqrts_post_res,
    &vrsra_post_res,
    &vrsubhn_post_res,
    &vscclrm_post_res,
    &vsdot_post_res,
    &vseleq_post_res,
    &vselge_post_res,
    &vselgt_post_res,
    &vselvs_post_res,
    &vshll_post_res,
    &vshrn_post_res,
    &vsmmla_post_res,
    &vsqrt_post_res,
    &vsra_post_res,
    &vstmdb_post_res,
    &vstmia_post_res,
    &vstr_post_res,
    &vsubhn_post_res,
    &vsubl_post_res,
    &vsubw_post_res,
    &vsudot_post_res,
    &vswp_post_res,
    &vtbl_post_res,
    &vtbx_post_res,
    &vcvtr_post_res,
    &vtrn_post_res,
    &vtst_post_res,
    &vudot_post_res,
    &vummla_post_res,
    &vusdot_post_res,
    &vusmmla_post_res,
    &vuzp_post_res,
    &vzip_post_res,
    &addw_post_res,
    &aut_post_res,
    &autg_post_res,
    &bfl_post_res,
    &bflx_post_res,
    &bf_post_res,
    &bfcsel_post_res,
    &bfx_post_res,
    &bti_post_res,
    &bxaut_post_res,
    &clrm_post_res,
    &csel_post_res,
    &csinc_post_res,
    &csinv_post_res,
    &csneg_post_res,
    &dcps1_post_res,
    &dcps2_post_res,
    &dcps3_post_res,
    &dls_post_res,
    &le_post_res,
    &orn_post_res,
    &pac_post_res,
    &pacbti_post_res,
    &pacg_post_res,
    &sg_post_res,
    &subs_post_res,
    &subw_post_res,
    &tbb_post_res,
    &tbh_post_res,
    &tt_post_res,
    &tta_post_res,
    &ttat_post_res,
    &ttt_post_res,
    &wls_post_res,
    &blxns_post_res,
    &bxns_post_res,
    &cbnz_post_res,
    &cbz_post_res,
    &pop_post_res,
    &push_post_res,
    &brkdiv0_post_res,
    &vpop_post_res,
    &vpush_post_res,
};